﻿<cfscript>
/** 
* ORM TeacherWorkload
* 
* @hint "Hibernate persistenter t_teacher_workload. 教师工作量汇总表" 
* 
*/ 

component 
	displayname="public.service.orm.senate.TeacherWorkload" 
	output=false 
	persistent=true 
	selectBeforeUpdate=true dynamicInsert=true dynamicUpdate=true 
	cacheuse="Transactional" 
	entityname="TeacherWorkload" 
	table="t_teacher_workload"
	{
	
	property type="string" name="TeacherTermWorkload" column="tchwl_id" fieldtype="id" generator="assigned" hint="教师学期工作量编号";

	property type="numeric" name="Workload" column="workloads" hint="工作量";
	
	property name="Term" fieldtype="many-to-one" fkcolumn="term_id" cfc="Term" hint="学期";
	property name="Teacher" fieldtype="many-to-one" fkcolumn="tch_id" cfc="Teacher"  hint="主讲教师";

	/**
	* @hint "自定义主键规则"
	* 
	* @Term "学期"
	* @Teacher "教师"
	*/
	public string function getID( required Term, required Teacher ) output=false {
		
		var nextID = arguments.Term.getTermID() & "," & arguments.Teacher.getTeacherID();

		/* 
			主键生成规则 
			
			培养方案号18位 3位学期代码 , 10位教师职工号

			Unique: TERM_ID, TCH_ID
		*/
		return nextID;
	}

}

</cfscript>